package com.lambkit.module.lms;

import com.jfinal.config.Routes;
import com.lambkit.component.swagger.SwaggerController;
import com.lambkit.module.admin.AdminInterceptor;
import com.lambkit.module.admin.AdminManager;
import com.lambkit.module.lms.controller.FileController;
import com.lambkit.module.lms.controller.HandlerController;
import com.lambkit.module.lms.controller.IndexDevController;
import com.lambkit.module.lms.controller.IndexHelpController;
import com.lambkit.module.lms.controller.IndexNoteController;
import com.lambkit.module.lms.controller.InterceptorController;
import com.lambkit.module.lms.controller.MappingController;
import com.lambkit.module.lms.controller.MonitorController;
import com.lambkit.module.lms.controller.PluginController;
import com.lambkit.module.lms.controller.PropController;
import com.lambkit.module.lms.controller.RouteController;
import com.lambkit.module.lms.controller.TagController;
import com.lambkit.web.WebConfig;

/**
 * @author Henry Yang 杨勇 (gismail@foxmail.com)
 * @version 1.0
 * @Package com.lambkit.module.cms
 */
public class LmsRoutes extends Routes {

	@Override
	public void config() {
		addInterceptor(new AdminInterceptor());
		addInterceptor(new LmsInterceptor());
		WebConfig web = AdminManager.me().getWebConfig();
		String ckey = web.getUrl();
		String lmsControllerKey = ckey + "/lms";
		add(lmsControllerKey, IndexDevController.class);
		add(lmsControllerKey + "/node", IndexNoteController.class);
		add(lmsControllerKey + "/route", RouteController.class);
		add(lmsControllerKey + "/handler", HandlerController.class);
		add(lmsControllerKey + "/plugin", PluginController.class);
		add(lmsControllerKey + "/tag", TagController.class);
		add(lmsControllerKey + "/interceptor", InterceptorController.class);
		add(lmsControllerKey + "/mapping", MappingController.class);
		add(lmsControllerKey + "/prop", PropController.class);
		add(lmsControllerKey + "/monitor", MonitorController.class);
		add(lmsControllerKey + "/file", FileController.class);
		add(lmsControllerKey + "/help", IndexHelpController.class);
		add(lmsControllerKey + "/swagger", SwaggerController.class, "/lambkit/swagger");
	}

}
